/*
 *  Copyright 2025 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
@import (reference) '../../../../../styles/variables.less';
@import (reference) '../../../../../styles/fonts.less';

.announcement-card-v1 {
  border: none;
  border-radius: @border-rad-lg;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  overflow: hidden;
  background: @white !important;

  &.disabled {
    cursor: not-allowed;
    pointer-events: none;
  }

  .announcement-card-v1-content {
    padding: @padding-sm;
    background: transparent !important;
    position: relative;

    .announcement-header-container {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: @size-xs;
      background: @white !important;
      border-radius: @border-rad-xs;

      .announcement-title-section {
        display: flex;
        align-items: center;
        gap: @size-xxs;
        flex: 1;
        min-width: 0;
        height: 44px;
        background: linear-gradient(270deg, @white -12.07%, @blue-24 500.72%);
        border-radius: @border-rad-xs;

        .user-name {
          font-weight: @font-semibold;
          white-space: nowrap;
          color: @primary-color;
          text-decoration: none;
          cursor: pointer;
          transition: color 0.2s ease;

          &:hover {
            color: @primary-color;
          }

          &:focus {
            outline: 2px solid @primary-color;
            outline-offset: 2px;
            border-radius: 2px;
          }
        }

        .field-operation-text {
          color: @primary-color;
          white-space: nowrap;
          font-weight: @font-regular;
        }

        .announcement-card-entity-icon {
          margin: 0 0 0 2px;
          color: @primary-color;
          width: @size-mlg;
          height: @size-mlg;

          svg {
            width: @size-md;
            height: @size-md;
          }
        }

        .announcement-entity-name {
          font-size: @size-md !important;
          font-weight: @font-medium !important;
          color: @primary-color;
          text-decoration: none;
          cursor: pointer;
          transition: color 0.2s ease;

          &:focus {
            outline: 2px solid @primary-color;
            outline-offset: 2px;
            border-radius: 2px;
          }
        }

        .announcement-entity-name-tooltip {
          color: @white;
        }

        .announcement-header {
          align-items: center;
          border-left: 3px solid @primary-color;
          border-radius: @border-rad-xs;
          display: flex;
          flex: 1;
          font-size: @size-md;
          font-weight: @font-semibold;
          gap: @size-xxs;
          height: 44px;
          line-height: 1.4;
          min-width: 0;
          overflow: hidden;
          padding: @size-xxs 0 @size-xxs @size-xxs;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }

      .timestamp {
        color: @primary-color;
        font-size: @size-sm;
        white-space: nowrap;
        margin-left: @padding-sm;
        flex-shrink: 0;
      }
    }

    .announcement-title {
      font-size: @font-size-base;
      font-weight: @font-medium;
      line-height: 1.4;
      margin: 0 0 @size-xxs 0;
    }

    .announcement-description {
      color: @grey-600;
      font-size: @size-sm;
      line-height: 1.5;
      margin: @size-xs 0 0 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .column-info {
      color: @text-color;
      font-size: @size-sm;
      margin: @padding-xs 0 0 0;

      .column-name {
        font-weight: @font-semibold;
        color: @text-color;
      }
    }
  }
}
